#include <cstdio>
#include <cstring>
#include <stack>

#define MAX_SIZE 10000

using namespace std;

int calc_pri(char c) {
    if (c == '+' || c =='-') return 1;
    else if (c == '*' || c == '/') return 2;

    return 0;
}

float calc(float x, float y, char sym) {
    if (sym == '+') return x + y;
    else if (sym == '-') return x - y;
    else if (sym == '*') return x * y;
    else if (sym == '/') return x / y;

    return 0;
}

bool is_digit(char x) {
    if (x <= '9' && x >= '0') return true;
    return false;
}

int main() {
    char str[MAX_SIZE];
    scanf("%s", str);
    int str_len = strlen(str);
    int count = 0;
    float num = 0;
    stack<float> nums;
    stack<char> syms;

    while (count < str_len) {
        if (is_digit(str[count])) {
            num = num * 10 + str[count] - '0';
        } else {
            nums.push(num);
            if ((syms.empty()) || calc_pri(syms.top()) < calc_pri(str[count])) {
                syms.push(str[count]);
            } else if (calc_pri(syms.top()) >= calc_pri(str[count])) {
                while (!syms.empty() && calc_pri(syms.top()) >= calc_pri(str[count])) {
                    float data1 = nums.top();
                    nums.pop();
                    float data2 = nums.top();
                    nums.pop();
                    char sym = syms.top();
                    syms.pop();
                    nums.push(calc(data2, data1, sym));
                }
                syms.push(str[count]);
            }
            num = 0;
        }

        ++count;
    }
    if (num != 0) {
        nums.push(num);        
    }

    while (!syms.empty()) {
        int data1 = nums.top();
        nums.pop();
        int data2 = nums.top();
        nums.pop();
        char sym = syms.top();
        syms.pop();
        nums.push(calc(data2, data1, sym));
    }

    printf("%.0f\n", nums.top());

    return 0;
}
